package com.ssmTest.service;

import com.ssmTest.model.User;
import org.springframework.ui.ModelMap;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpSession;
import java.util.List;

public interface IUserService {
    //根据电话账号查找用户
     User selectUserPhone(String phone);
    //根据id查找用户
     User selectUser(int id);
    //根据用户状态查找用户
     List<User> selectByState(int state);
    //根据用户状态查找用户
     List<User> selectByStates();
    //检查用户已存在
     boolean user_Check(String id);
    //插入用户
     void insertUser(User user);
    //更新修改信息
     void updateUser(User user);
    //用户登录
     int userLogin(String phone_number, String passwd, ModelMap modelMap);
     int userLogins(HttpSession session,String phone_number, String passwd, ModelMap modelMap);
    //用户注册
     int userRegister(String phone_number, String passwd,  String invitation_code, int customer_type);
    //个人信息完善
     int informationPerfection(int id, MultipartFile group_photo, int gender, String work_year, String drving_license, String payment, String address, String planting_type);
    //个人信息修改
     void informationModification(String group_photo,String work_year,String drving_license,String payment,String address);
    //更改用户审核状态
     void userAudit(String phone,int state);
    //dao更新状态
     void updateUserState(User user);
    //dao更新审核失败原因
     void updateFailReasion(User user);
    //检查密码是否正确
     boolean checkPw(String username,String passwd);
    //检查密码是否正确
     int changePw(String username,String oldPasswd,String passwd);

    int numberOfUser(int state);
    int numberOfUser(String startdate,String enddate);
    //实名认证
    int updateIDCard(int id,String id_card,String id_number);
    int updateGateway(int id,String id_card);
    int updateLicense(int id,String driving_license);

    List<User> selectUserByInvitCode(String invitation_code);
    User selectInvitCode(String invitation_code);
}
